<template>
  <div class="page-navbar">
    <div class="navbar-back"  v-on:click="goBack"></div>
    <div class="navbar-title">{{navTitle}}</div>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({
  navTitle: {
    type: String,
    default: '表格'
  }
})
//用ts写法
const emit = defineEmits<{
  (e: 'backHandler'): void
}>()
const goBack = () => {
  emit('backHandler')
}

</script>
<style scoped lang="less">
.page-navbar {
  height: 88px;
  width: 100%;
  padding: 40px 15px 0;
  position: fixed;
  top: 0;
  box-sizing: border-box;
  z-index: 100000;
  align-items: center;
  background-color: #fff;
  .navbar-back {
    width: 8px;
    height: 24px;
    position: absolute;
    left: 15px;
    top: 40px;
    background: url('@/assets/back.png') no-repeat center/100%;
  }
  .navbar-title {
    font-size: 18px;
    color: #000;
    font-weight: 500;
    text-align: center;
    margin: 0 auto;
  }

}
</style>
